package utils
{
	 
	import flash.events.Event; 
	import mx.events.IndexChangedEvent; 
	
	public class PageChangeEvent extends Event 
	{ 
		
		 
	public var PageIndex:int=0; 
	public var PageSize:int=0; 
	
	public function PageChangeEvent(pageindex:int,pagesize:int) 
	{ 
		super("PageChange",false); 
		PageIndex= pageindex; 
		PageSize =pagesize; 
	}

	
	public function Filter(list:Array):Array 
	{ 
		var newlist:Array = new Array(); 
		var start:int = PageSize*PageIndex; 
		var end:int = start+PageSize; 
		for(var i:int = start;i<end;i++) 
		{ 
		if(i< list.length) 
		{ 
			newlist.push(list[i]); 
		} 
		else 
			break; 
		} 
		return newlist; 
		} 
	} 

}